#coding=gbk
#--------------------------------------------------------------------------------
#    Do NOT extend ANY variables to two or more lines except type({}) vars 
#--------------------------------------------------------------------------------
import Queue,cPickle as pc, time

# dirs to index
DIRS = [u'd:\\workspace']

# watched dirs
WATCH_DIRS = [u'd:\\install', u'd:\\Documents and Settings\\chris.ZQC-3EA69BFCAD7\\My Documents',u'd:\\book\\tech']

# do not watch or index these foldersc
EXCLUDE_DIRS = [u'd:\\workspace\\pyindexer\\works\\index', u'd:\\videos']


# file parsers
SUPPORT_FORMAT = {
    ('txt','cue','m3u','py','java'):'pyds.textsegment.plugin_reader', # basic plain text parser
    ('htm','html','asp','jsp','php'):'pyds.plugin_html.html_reader'   # a html parser
}

# time interval between index files
INDEX_INTERVAL = 0.2

# time interval of adding a word to database
INDEX_WORD_INTERVAL = 0.02

# time interval of dumpping index list to disk
DUMP_INTERVAL = 30

# max length of a snapshot
MAX_SNAPSHOT_LEN = 65535

# result per page, -1 for all
RESULT_PER_PAGE = 30

# sleep time for text segment
TEXT_SEGMENT_INTERVAL = 0.02

# interval for converting posstr to indexobj
POSSTR_TO_INDEXOBJ_INTERVAL = 0.02

# sleep time for index list creation
WALK_INTERVAL = 0.02


# ------------------DO NOT modify var Below-------------------------#

# indexer thread waiting this singal
LIST_CREATED = False

# thread stop flag
STOP_FLAG = False

# current index queue
INDEXQUEUE = Queue.Queue()

# current index list
INDEXLIST = []

# global database, only used by database module 
DATABASE = None

# last indexed file
LAST_INDEX = ''

# file that has been indexd
FILE_INDEXD = 14300

# if database is in use
DB_IN_USE = False

# suspend index thread
PAUSE_INDEX = False

# Working threads
CRAWL_THREAD = None

INDEXER_THREAD = None

WATCHER_THREAD = None

UI_THREAD = None

WEBSERVER_THREAD = None